UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVm1va1gJ0RCLyqAIbOb3zHdqcw+7u0hKyKEBbNVt9k='
WHERE
key_id = 'ae452658dbc67aab5aef442a3d80188d44784587ba208b3ae544fceab796748b'
AND (
token = 'rVm1va1gJ0RCLyqAIbOb3zHdqcw+7u0hKyKEBbNVt9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)