UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qOucXoiHP/34oxvabOR7zf1nM7oiMi1HLf4FjgcrBIg='
WHERE
key_id = '542dfbbc7ff79fb3104b3197d95be58835436cf2b6d2823c3d42ac461765c4dc'
AND (
token = 'qOucXoiHP/34oxvabOR7zf1nM7oiMi1HLf4FjgcrBIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)