UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jEPeeE+kcjdncu59QQgZChMYQS6vngKe+pZQRxiG2No=' 
WHERE 
  key_id = '5ae7c8f08676a02664574c2d59dee5b5bb70bab22bfbe7e90fec79428ccbc958' 
  AND (
    token = 'jEPeeE+kcjdncu59QQgZChMYQS6vngKe+pZQRxiG2No=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028