UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gGofAa3OzGQPiAKixliUyeoOjjrGIEUzN5uAFNLCghI='
WHERE
key_id = '2c9fe4fe405b96c1c6f6b39ddbbdf23becf26cc96ebea48ecaa92bfd8d3fb0d3'
AND (
token = 'gGofAa3OzGQPiAKixliUyeoOjjrGIEUzN5uAFNLCghI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)