UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EJpsyYiqGU4kWaM74UQ33pIu/apuGX1+qlq3xYC5YGQ=' 
WHERE 
  key_id = 'f64d481572c11506c708dc7cc54a52662b4a1fb725284325879932d3c83375e8' 
  AND (
    token = 'EJpsyYiqGU4kWaM74UQ33pIu/apuGX1+qlq3xYC5YGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044