UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/+S8uNpiGe6/dJBC/ucEUQhMbZlGlpfhq0tCLO+vhdo='
WHERE
key_id = '8c9a91d4bf9659b5cd59780697e8a63180e2cc471a25aa7b7bb9665be1aa74ba'
AND (
token = '/+S8uNpiGe6/dJBC/ucEUQhMbZlGlpfhq0tCLO+vhdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)