UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'joEJjAuHkICVE9fWR+IBDUuhLWcxC06UB7mOl0kBzMQ='
WHERE
key_id = '40844042df3b84943094ca3e498ef4fc827ac774546c57c09e71488085be5d3d'
AND (
token = 'joEJjAuHkICVE9fWR+IBDUuhLWcxC06UB7mOl0kBzMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)