UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PMjN/WYUat/IzStRZz8S3g9FyQobudgHii+c2dBlW7U=' 
WHERE 
  key_id = 'f5dacb3d04dbda183a8a67020e34367e8cb44d7abe82977a4edcf17e3b92bc9e' 
  AND (
    token = 'PMjN/WYUat/IzStRZz8S3g9FyQobudgHii+c2dBlW7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038