UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0LBy7DYeUCHO1fNA8iqKIgo853M/I90vn4LvEAdTy6o='
WHERE
key_id = '8f1f3689c4746785a4adaa9de14c2b8d6901103a6d6ad3833507d25216eb4365'
AND (
token = '0LBy7DYeUCHO1fNA8iqKIgo853M/I90vn4LvEAdTy6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)