UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94YLTRSTHVtMCS5VkcsiOSKxU5UrnylEO0OAoyvTc8Q=' 
WHERE 
  key_id = '0331f6b18a5656714828acb5d36e56b0c7aacd8218eee22d66b39b103fd831de' 
  AND (
    token = '94YLTRSTHVtMCS5VkcsiOSKxU5UrnylEO0OAoyvTc8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056