UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lChOdX2VCnv8Ugsh8m4imCsJAaGOjvPlVpML0Tq8s/Y=' 
WHERE 
  key_id = 'b59bef14ca3bc3857185ba07fe77cb1dbff4a7d6f32605485647e6da6d6bddef' 
  AND (
    token = 'lChOdX2VCnv8Ugsh8m4imCsJAaGOjvPlVpML0Tq8s/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046