UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UShSkV/YWwj5bB1l+8+GIm0tiQkFBQS8T2rzi9HmfeQ=' 
WHERE 
  key_id = '78921b75c9c39f75a47ca9c3c6530b9a2c21b89d0e9d0451f85af3e169e992f7' 
  AND (
    token = 'UShSkV/YWwj5bB1l+8+GIm0tiQkFBQS8T2rzi9HmfeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027