UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gl9gUaKbGVdpzhlMfx9uIYLrnR7GzYHesS8ZGW4ql+M=' 
WHERE 
  key_id = '7c7de099c425606abdc5a2e411835bc0e6733e15b090619acd0d3913ecf44979' 
  AND (
    token = 'Gl9gUaKbGVdpzhlMfx9uIYLrnR7GzYHesS8ZGW4ql+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033