UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yZ1H04Pc84d1Ye9RV2HnOaM0Hccd3jyaiWkpd9epFl8=' 
WHERE 
  key_id = '67f026338e0fc740b462dcf71848e0dda858db7cff7be14464a2c90f75bdcd2a' 
  AND (
    token = 'yZ1H04Pc84d1Ye9RV2HnOaM0Hccd3jyaiWkpd9epFl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034