UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OrDoZxzJdfX/icqeuxPaMurpglVekm2DQaU7JfpqbxI='
WHERE
key_id = 'ec9b4e283b70185b39358fe242b616e86f1ea013d749f3d40aff9dd6fa539114'
AND (
token = 'OrDoZxzJdfX/icqeuxPaMurpglVekm2DQaU7JfpqbxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)