UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lani5saJr1e67Vkq4JRgmbMIKPLsoMbSPjV/ftoMmvY=' 
WHERE 
  key_id = '5afc50b759a65b58aaf64e44423efdb3fbd2a96eb38ce942857705ee91696cc5' 
  AND (
    token = 'lani5saJr1e67Vkq4JRgmbMIKPLsoMbSPjV/ftoMmvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027