UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EJT+iG0/tMabPAZflqsmc4u6UJhQA7HVi5wTpJjKNQQ='
WHERE
key_id = 'd6832f2e489280c6ee2698dd5160e72b4e8e8bc8bebd3af0761f706a615e0f31'
AND (
token = 'EJT+iG0/tMabPAZflqsmc4u6UJhQA7HVi5wTpJjKNQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)