UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HnxZtTckdry2pNFqLacCQp0xPGlVD/Suzr6G7he4Vnk=' 
WHERE 
  key_id = '6d9ad7c734ed84c652a4bd4d28952912d871a9c63249ba15f83de310b90257ae' 
  AND (
    token = 'HnxZtTckdry2pNFqLacCQp0xPGlVD/Suzr6G7he4Vnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056