UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pJNxzwBQuDqt+wCUOTNR9Psh4krwxqvk+/vD0jZJH+k=' 
WHERE 
  key_id = '2f448bfc7c8694bf0620a4d542e0fe4d3bb6b9ff68f9572a55a3b5830276068d' 
  AND (
    token = 'pJNxzwBQuDqt+wCUOTNR9Psh4krwxqvk+/vD0jZJH+k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047