UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+u2UuGZRmlv11tLGYg1LaQfJ23gh2fcq8PmcdeprctM='
WHERE
key_id = '2bb9e9e4b53f53b9ec50390d76c283f447bee131c8d4e94074a82f6b2daf80ef'
AND (
token = '+u2UuGZRmlv11tLGYg1LaQfJ23gh2fcq8PmcdeprctM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)