UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1+eEmN+hBrLhiab07m0h/cmjs4++IG/5gmjeoyx2APk=' 
WHERE 
  key_id = 'cd400e0d7a1ebe52f76e02b990fb3b20a62becb34c2f74757d53260cbacdb3e6' 
  AND (
    token = '1+eEmN+hBrLhiab07m0h/cmjs4++IG/5gmjeoyx2APk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038