UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3A0+j9kOlVhTEUWVvtSm9IRsa07dA9oncSWaYGvh6pQ=' 
WHERE 
  key_id = '01e0629004d9fce181be4a44beb45cfed9f33da8031a8dd5837ee4fe6f1ff741' 
  AND (
    token = '3A0+j9kOlVhTEUWVvtSm9IRsa07dA9oncSWaYGvh6pQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020