UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cXRY+ABZE7ipEerYLkVMeEigRUDcgSChcd/a93wDVSs='
WHERE
key_id = '69566cd5a14923b7ded5b0bc3c6cb8703c8caef2b1b7f786bf1cf238678eec96'
AND (
token = 'cXRY+ABZE7ipEerYLkVMeEigRUDcgSChcd/a93wDVSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)