UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yE3Imste0kDeKSecxWbw6BYGZXL2foSRcOKipaBFdng='
WHERE
key_id = '5ba4aa809fbcdd405e89266902e4c61d8886a9e5d1a2cb659c61ac75133feca4'
AND (
token = 'yE3Imste0kDeKSecxWbw6BYGZXL2foSRcOKipaBFdng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)