UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b3uvfDqOkOiItSypQ/sx50+8wIpKN2f+gJtkTpcbelM=' 
WHERE 
  key_id = '05c3c5588879b06d2ba3f166df6580bd339eb06e304cd388debeef8fca5a2732' 
  AND (
    token = 'b3uvfDqOkOiItSypQ/sx50+8wIpKN2f+gJtkTpcbelM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017