UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FjUQLWvqj/EbqDsQzpo161HMnOLPMrOmUYXlL72DhQs='
WHERE
key_id = '1052c7612d7ff838c975dba6b36231a9a5862793ecc109a04be4be5d720ebabd'
AND (
token = 'FjUQLWvqj/EbqDsQzpo161HMnOLPMrOmUYXlL72DhQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)