UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAHC39OlNynRPMKTxk2wevO9kvfwH9GfZ5Y4aXrBhLg='
WHERE
key_id = '7832fcdf6e31d95d21ea6e59417245640cd3823287d448c936078de0ed7a4eba'
AND (
token = 'yAHC39OlNynRPMKTxk2wevO9kvfwH9GfZ5Y4aXrBhLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)