UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vqZcSNCDDeONWlPRBrFNK9MGGoEB+NIWkapRcYXXTPw='
WHERE
key_id = 'c3cc0654bebf869daa46ea5c6b283637abf388b9ed4f2a997e82cb2fb39738be'
AND (
token = 'vqZcSNCDDeONWlPRBrFNK9MGGoEB+NIWkapRcYXXTPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)