UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yg+CG6/Ir0gnIPlAkS5cR1ldOwEDovjX4N91vSYmsjs=' 
WHERE 
  key_id = '7ab03f830a7b8c823184e90eb0aff0880c1798e947ee64bc97e34129bb0092ba' 
  AND (
    token = 'yg+CG6/Ir0gnIPlAkS5cR1ldOwEDovjX4N91vSYmsjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043