UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3fl7GwJubxuKJAUK4WzMSCeWkUuw0hbFjVSf0hOGXzk='
WHERE
key_id = 'cda13fcb461eee05ff091c618188d13f9cb5532107da53b685f6ed1f332c9507'
AND (
token = '3fl7GwJubxuKJAUK4WzMSCeWkUuw0hbFjVSf0hOGXzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)