UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U094UDbV8zW2em9E04U+ajqWOIey0sWQtdlkzrJOJic='
WHERE
key_id = 'd4b2680abe5decf078651e2aa80ce51642afcc5c120474e882e43f145e4b62db'
AND (
token = 'U094UDbV8zW2em9E04U+ajqWOIey0sWQtdlkzrJOJic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)