UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJerCOoDf3bHC1/Fr1+UqYb1XpBejcv336KydDUlgdU='
WHERE
key_id = '5f234cfce8eecae4e5b268bff6f3bcf5d501fd543d2223e8b5895ee083160a22'
AND (
token = 'cJerCOoDf3bHC1/Fr1+UqYb1XpBejcv336KydDUlgdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)