UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EodazTb23ib5lVjOo3qMLcykWv/K0EQ1OogTYZ75ZwY=' 
WHERE 
  key_id = '493620bbe0d5f5bd1e816b9dcb13135750f03d3066c41281285d85aa8d27eec9' 
  AND (
    token = 'EodazTb23ib5lVjOo3qMLcykWv/K0EQ1OogTYZ75ZwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021