UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LOcCExdAdkCuWmwOZXJxnjdzvV5wsyAajafFpx95Gpw='
WHERE
key_id = '3f8805ae83565442f3adc2a4a74e4d3a217687611f7dff04197d1d5653e79beb'
AND (
token = 'LOcCExdAdkCuWmwOZXJxnjdzvV5wsyAajafFpx95Gpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)