UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't35cIIAYZEpOGRbP+9YbyatOG5rTh9DZMG/yp4d4nRE='
WHERE
key_id = '9cc61e0c4ae58df11992aa564a2617d9acb9bcf39815dffa67f4ea54f68e73b4'
AND (
token = 't35cIIAYZEpOGRbP+9YbyatOG5rTh9DZMG/yp4d4nRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)